Add ucode export for managed config JSON - #397
Merged
Merged
Conversation
ucode export for managed config JSONucode export for managed config JSON
david-siqi-liu
force-pushed
the
david-siqi-liu/AIGTWY-4339
branch
from
August 26, 2026 17:31
689de36 to
aa736d1
Compare
david-siqi-liu
force-pushed
the
david-siqi-liu/AIGTWY-4339
branch
from
August 26, 2026 17:35
aa736d1 to
930d411
Compare
rohita5l
approved these changes
Aug 26, 2026
rohita5l
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. config needs the first field as spec_version and version needs to be 1
Add a role-agnostic `ucode export` that serializes the workspace's local managed coding-agent config to the external CodingAgentConfig JSON that a future `ucode publish -f <path>` will consume. It reads only local state, makes no network / auth / admin calls, and mutates nothing but the optional --output file. - New managed_export.py: validate through validate_manifest, serialize through serialize_managed_config, strip the server-owned resource name; write to stdout (one trailing newline) or atomically to --output/-o (temp file in the destination dir + os.replace, no parent-dir creation, temp cleaned up on failure, ~ expanded). - Wire `ucode export` (--output/-o) in cli.py; errors go to stderr, nonzero exit. - Document `ucode export` in the README. - Tests: stdout/file byte-identity, empty stdout in file mode, atomic replace, validation/write failure paths, no-auth/admin, and parser/validator round-trip. Co-authored-by: Isaac <no-reply@databricks.com>
david-siqi-liu
force-pushed
the
david-siqi-liu/AIGTWY-4339
branch
from
August 26, 2026 17:50
930d411 to
0607257
Compare
david-siqi-liu
enabled auto-merge (squash)
August 26, 2026 17:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a role-agnostic
ucode exportthat serializes the workspace's local managed coding-agent config to a portable JSON that a futureucode publish -f <path>will consume. It is read-only and offline: no auth, no admin check, no discovery, no publish, and the only write is the optional output file.The output leads with the source
workspaceURL and aspec_version(the export format version), followed by the externalCodingAgentConfig.Changes
managed_export.py: validate throughvalidate_manifest, serialize throughserialize_managed_config, strip the server-owned resourcename, and prefix the sourceworkspaceandspec_version. Writes to stdout (one trailing newline, nothing else) or atomically to--output/-o(temp file in the destination dir +os.replace, no parent-dir creation, temp cleaned up on failure, existing file replaced without--force,~expanded).ucode exportincli.py; diagnostics and errors go to stderr, nonzero exit on failure.ucode exportin the README.workspace, thenspec_version), stdout/file byte-identity, empty stdout in file mode, atomic replace, validation and write-failure paths, no auth/admin lookup, admin vs non-admin parity, and a config round-trip through the canonical parser and validator.Credentials and runtime state are excluded via the existing serializer (it omits internal resource ids, timestamps, and user ids); the resource
nameis stripped on top. The sourceworkspaceURL is included by design. Agentcustom_headersare preserved so the config round-trips throughpublish.Validation
Verified end to end against a real workspace across three configs: agents-only, agents + MCP servers, and agents + a tiered spend policy. In file mode stdout is left empty and the bytes match stdout mode;
~in the output path is expanded. Example output (identifiers replaced with placeholders):{ "workspace": "https://<workspace-host>", "spec_version": 1, "default_agent": "CODING_AGENT_CLAUDE_CODE", "enabled_agents": [ { "agent": "CODING_AGENT_CODEX", "config": { "use_as_global_settings": false, "model_config": { "codex": { "default_model": "system.ai.gpt-5" } } } }, { "agent": "CODING_AGENT_CLAUDE_CODE", "config": { "use_as_global_settings": false, "model_config": { "claude": { "default_model": "system.ai.claude-opus-5", "models": { "default_fable_model": "system.ai.claude-fable-5", "default_opus_model": "system.ai.claude-opus-5", "default_sonnet_model": "system.ai.claude-sonnet-5", "default_haiku_model": "system.ai.claude-haiku-4-5" } } } } } ], "mcp_servers": [ { "name": "databricks-sql", "type": "MCP_SERVER_TYPE_DATABRICKS_SQL" }, { "name": "system-ai-github", "type": "MCP_SERVER_TYPE_UC_SERVICE" }, { "name": "system-ai-genie_one", "type": "MCP_SERVER_TYPE_UC_SERVICE" } ], "budget_policy": { "display_name": "coding-agents-tiered-routing", "budget_id": "00000000-0000-0000-0000-000000000000", "tiers": [ { "spending_percentage": 0.5, "default_agent": "CODING_AGENT_CLAUDE_CODE", "default_model": "system.ai.claude-sonnet-5" }, { "spending_percentage": 0.8, "default_agent": "CODING_AGENT_CLAUDE_CODE", "default_model": "system.ai.claude-haiku-4-5" } ] } }This pull request and its description were written by Isaac.